<?php
/**
 * Created on 7 mai 2011
 * * @author Samy Deghou(deghou@polytech.unice.fr ; deghou@embl.de)
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 
class Database
{

	// Attributs
	private static $server = "localhost"; // port
	private static $user = "root"; // utilisateur
	private static $password = "epu"; // mot de passe 
	private static $db = "spectradb"; // nom de la base de donnees

	/*Ouverture d'une connexion a la BDD*/
	public static function connect() 
	{
		$connection=mysql_connect(self::$server,self::$user,self::$password)
		or die("unable to connect to database server");
		mysql_select_db(self::$db) or die("unable to select database");
		return $connection;
	}

	/* Fermeture de la connexion a la BDD*/
	public static function disconnect($connection)
	{
	//	var_dump($connection);
		if($connection!=null){
			mysql_close($connection);	
		}
	}

}

?>
